﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="6002.aspx.cs" Inherits="_60_6002" %>

<%@ Register Assembly="MattBerseth.WebControls" Namespace="MattBerseth.WebControls" TagPrefix="cc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script type="text/javascript">
    function update(msg) {
        __doPostBack('<%=UpdatePanel1.ClientID%>', '');
        tb_remove();
        alert(msg);
    }

    function pageLoad(sender, args) {
        if (args.get_isPartialLoad()) {
            //  reapply the thick box stuff
            tb_init('a.thickbox, input.thickbox,');
        }
    }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>

    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectCountMethod="Get_board_AllData_Count" SelectMethod="Get_board_AllData"
        TypeName="CCH.DAO.boardDAO" EnablePaging="True">
        <SelectParameters>
            <asp:Parameter Name="boa_isreply" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>

    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div class="DivButton">
            </div>
            <div style="margin:0 29px;">
                <asp:RadioButtonList ID="rbl_isReply" runat="server" RepeatDirection="Horizontal" 
                    RepeatLayout="Flow" AutoPostBack="True" 
                    onselectedindexchanged="rbl_type_SelectedIndexChanged">
                    <asp:ListItem Value="0" Selected="True">全部</asp:ListItem>
                    <asp:ListItem Value="1">未回覆</asp:ListItem>
                    <asp:ListItem Value="2">已回覆</asp:ListItem>
                </asp:RadioButtonList>
            </div>
            <div class="datatable">
                <cc1:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" AutoGenerateColumns="False"
                    AllowPaging="True" EmptyDataText="目前無資料" DataKeyNames="boa_no" 
                    onrowcommand="GridView1_RowCommand">
                    <Columns>

                        <asp:TemplateField HeaderText="留言主題">
                            <ItemTemplate>
                                <asp:Label ID="Label5" runat="server" Text='<%# Eval("boa_title") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="留言時間">
                            <ItemTemplate>
                                <asp:Label ID="Label4" runat="server" Text='<%# Get_DateTime(Eval("boa_datetime")) %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="10%" HorizontalAlign="Center" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="回覆者">
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Get_peopleName(Eval("boa_replyID")) %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="10%" HorizontalAlign="Center" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="回覆時間">
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%# Get_DateTime(Eval("boa_replyDT")) %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="10%" HorizontalAlign="Center" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="回覆" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <a class="thickbox imageButton edit" title='' href='<%# Eval("boa_no", "6002-1.aspx?ID={0}&modal=true&TB_iframe=true&width=800") %>'>
                                <span>回覆</span></a>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="8%" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="刪除">
                            <ItemTemplate>
                                <asp:Button ID="button_disable" runat="server" CommandName="disable" CssClass="delete"
                                    CommandArgument="<%# Container.DataItemIndex %>" OnClientClick=" return confirm('確定要刪除留言?')" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="7%" />
                        </asp:TemplateField>

                    </Columns>
                </cc1:GridView>
            </div>
            <div class="pager">
                <asp:DataPager ID="DataPager1" runat="server" PagedControlID="GridView1" PageSize="25">
                    <Fields>
                        <CCH:GooglePagerField />
                    </Fields>
                </asp:DataPager>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

